Adjust alt text generation to more closely match the W3C Alt decision tree#374
Conversation
…ge, link whether it's a link or has a caption. Support returning decorative alt text
…nk or has a caption. Provide support for decorative images and blank alt text
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #374 +/- ##
=============================================
+ Coverage 59.75% 59.77% +0.01%
- Complexity 701 702 +1
=============================================
Files 49 49
Lines 3558 3572 +14
=============================================
+ Hits 2126 2135 +9
- Misses 1432 1437 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What?
Closes #350
Adjust alt text generation to better consider the W3C Alt decision tree
Why?
Currently our alt text generation experiment generates alt text that is more or less just a description of the image. While this isn't completely incorrect, it doesn't account for other situations where the alt text should be something else, like if an image is decorative or if the image is acting as a link.
Based on the feedback in #350, this PR adjusts the experiment to try and more closely match the W3C Alt decision tree, noting it's still up to the LLM to honor those guidelines.
How?
image_metaparam to our Alt Text Generation AbilityUse of AI Tools
Used both Claude Code running Opus 4.6 and Cursor running GPT-5.3 Codex to generate separate plans and execute those plans. I then compared the approaches and combined bits and pieces of both to get to a final state
Testing Instructions
npm i && npm run build